package com.walker.controller.catalogue;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.walker.anno.ResponseResult;
import com.walker.service.catalogue.CatalogueFieldService;

import net.sf.json.JSONObject;

/**
 * 资产-目录-字段
 */
@RestController
@RequestMapping(value = "/catalogueField")
@ResponseResult
public class CatalogueFieldController {

	@Resource
	private CatalogueFieldService service;
	
	/**
	 * 字段列表
	 * @param request
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@PostMapping("queryFieldList")
	public Map<String, Object> queryFieldList(@RequestBody String request) {
		Map<String, Object> params = JSONObject.fromObject(request);
		return service.queryFieldList(params);
	}
	
	/**
	 * 项目信息
	 * @return
	 */
	@PostMapping("queryProjectInfo")
	public List<Map<String, Object>> queryProjectInfo() {
		return service.queryProjectInfo();
	}
	
	/**
	 * 表信息
	 * @param project_id
	 * @return
	 */
	@PostMapping("queryCubeInfo")
	public List<Map<String, Object>> queryCubeInfo(@RequestBody(required = false) String project_id) {
		return service.queryCubeInfo(project_id);
	}
}